<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录页</title>
</head>
<body>
<script language="JavaScript" src="js/jquery-3.4.1.js"></script>
    <div id="loginDiv">
        <div id="debug"></div>
        邮箱:<input type="text" id="email"><br/>
        密码:<input type="password" id="pwd"><br>
        <input type="button" value="登陆" id="loginBtn"><br/>
        <a href="regist.html">没有账号，注册</a>
    </div>
<script>
    $(document).ready(function(){



        $("#loginBtn").click(function () {
            res=$.ajax({url:"http://www.txy.com:9003/api/user/login?email="+$("#email").val()+"&password="+$("#pwd").val(),async:false,type:'POST'});
            console.log("登陆:"+res.responseText)
             if(res.responseText!="") {
                location.href = "main.html?token="+res.responseText
            }

        })


    });
</script>
</body>
</html>